package com.bridgeintelligent.tag.webserver.schedule.service.imp;

import com.bridgeintelligent.tag.webserver.schedule.api.ITaskLogService;
import com.bridgeintelligent.tag.webserver.schedule.api.entity.TaskLog;
import com.bridgeintelligent.tag.webserver.schedule.service.mapper.TaskLogMapper;
import com.wayneleo.quickstart.framework.IDGenerator;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @description
 * @author: grp 2021-01-13 10:28
 **/
@Service
@AllArgsConstructor
public class TaskLogServiceImpl implements ITaskLogService {

    private TaskLogMapper taskLogMapper;
    @Override
    public void save(String id) {
        taskLogMapper.insert(IDGenerator.gen(),id,new Date());
    }

    @Override
    public List<TaskLog> top3(String jobType) {
        return taskLogMapper.top3(jobType);
    }
}
